<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWechatOffiaccountCsMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_offiaccount_cs_messages', function (Blueprint $table) {
            $table->id();
			$table->string('name',50)->default('');
			$table->string('reply_type',20)->default('text');
            $table->text('reply_content')->nullable();
            $table->timestamps();
        });
        Schema::create('wechat_offiaccount_cm_mf', function (Blueprint $table) {
            $table->id();
			$table->integer('wechat_offiaccount_cs_message_id');
			$table->integer('wechat_offiaccount_message_function_id');
        });
        Schema::create('wechat_offiaccount_cm_ef', function (Blueprint $table) {
            $table->id();
			$table->integer('wechat_offiaccount_cs_message_id');
			$table->integer('wechat_offiaccount_event_function_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wechat_offiaccount_event_logs');
        Schema::dropIfExists('wechat_offiaccount_cm_mf');
        Schema::dropIfExists('wechat_offiaccount_cm_ef');
    }
}
